<link rel="stylesheet" type="text/css" href="<?=gurl('css');?>/index.css" />
<style type="text/css">
@media screen and (-webkit-min-device-pixel-ratio:0) {#remember{margin-bottom:5px;}}
</style>
<script language="javascript" src="<?=gurl('js');?>/user.js"></script>
<div class="login">
<? if($account):?>
<a href="/home/profile/<?=$account["account_id"];?>"><?=$account["account_username"];?></a><a href="<?=gurl('accounts/logout');?>">退出</a><a href="<?=gurl('about/contact');?>">建议</a>
<? else:?>
<a href="<?=gurl('accounts/');?>">登录</a><a href="<?=gurl('accounts/');?>">注册</a><a href="<?=gurl('about/contact');?>">建议</a>
<? endif;?>
</div>
<div class="w940">
	<div class="webShow">
		<span class="tl"></span><span class="tr"></span>
		<div class="cc" id="indexbanner">
		</div>
		<span class="bl"></span><span class="br"></span>
	</div>
	<div class="loginBox">
		<span class="tl"></span><span class="tr"></span>
		<div class="cc">
		<? if($account):?>
			<dl>
				<dt>
					<span class="logLeft"><img class="blank" src="images/tran.gif" /><a href="/home/profile/<?=$account["account_id"];?>"><img src="<?=gurl('data');?>/upload_pic/<?=$account['photo'];?>" onerror="this.onerror='';this.src='<?=gurl('images');?>/userlogo.gif';" width="40" height="40" /></a></span>
					<span class="logRight">
						<a class="tit" href="/home/profile/<?=$account["account_id"];?>"><?=$account["account_username"];?></a>
					</span>
				</dt>
				
				<dt>
				<? if($usersite):?>
					<span class="logLeft"><img class="blank" src="images/tran.gif" /><a href="<?=c('site_url');?><?=$usersite['domain'];?>"><img src="<?=gurl('data');?>/upload_pic/<?=$usersite['info']['logo'];?>" onerror="this.src='<?=gurl('images');?>/hotweblog.gif';" width="40" height="40" /></a></span>
					<span class="logRight">
						<a class="tit" href="<?=c('site_url');?><?=$usersite['domain'];?>"><?=$usersite["name"];?></a>
						<em><a href="<?=c('site_url');?><?=$usersite['domain'];?>"><script language="javascript" src="<?=gurl('site_statis/funs/'.$usersite["id"]);?>"></script></a>人关注</em>
					</span>
				<? endif;?>
				</dt>
				
				<dd><? if($myfuns>0):?>关注<a href="/home/site/<?=$account["account_id"];?>"><?=$myfuns;?></a>个轻站<? endif;?></dd>
				<dd><? if($mymessages>0):?><a style="color:#bd202e;" href="/home/inbox/<?=$account["account_id"];?>">新邮件</a> <? endif;?><? if($newcomment):?><a style="color:#bd202e;" href="/home/comment/<?=$account["account_id"];?>">新回应</a> <? endif;?><? if($mynotices>0):?><a style="color:#bd202e;" href="/home/notice/<?=$account["account_id"];?>">新通知</a><? endif;?></dd>
			</dl>
		<? else:?>
		<form name="loginform" id="loginform" method="post" action="<?=gurl('accounts/login');?>">
			<ul class="lgi">
				<li><span>Email：</span><input name="loginemail" id="loginemail" type="text" class="lgiTxt hilightbox" /></li>
				<li><span>密码：</span><input type="password" name="loginpassword" id="loginpassword" class="lgiTxt hilightbox" /></li>
			</ul>
			<p class="point" id="ts">&nbsp;</p>
			<p class="lgiKey"><span class="fgt"><a href="<?=gurl('accounts/forget');?>" class="cCBlue">忘记密码</a></span><span><input name="remember" id="remember" type="checkbox" value="1" checked />记住我</span><span><input name="logindosubmit" id="logindosubmit" type="button" onclick="check_sitelogin_form();" value="登录" class="blueKey" /></span><span><input type="button" value="注册" class="blueKey" onclick="window.location.href='<?=gurl('accounts/');?>'" /></span></p>
		</form>
		<? endif;?>
		</div>
		<span class="bl"></span><span class="br"></span>
	</div>
	<div class="hackbox"></div>
</div>
<div class="blank8"></div>
<div class="w940">
	<div class="w660">
		<div class="leftBox">
			<ul>
				<li class="fKey"><a class="cGray" href="<?=gurl('found');?>">发现轻站</a></li>
				<li class="kKey"><? if($account):?><a class="cGray" href="<?=gurl('accounts/opening');?>"><? else:?><a href="#TB_inline?height=120&width=396&inlineId=hiddenModalContentforopen&modal=true" class="cGray applyKey thickbox"><? endif;?>开轻站</a></li>
				<li class="hKey"><a class="cGray" href="<?=gurl('rank');?>" >轻站TOP100</a></li>
			</ul>
		</div>
		<div class="content">
			<h1><a id="fresh" name="fresh">&nbsp;</a>新鲜事</h1>
			<? if($account && $myfuns>0):?>
			<h3 class="f14px">每日一站：<a href="<?=c('site_url');?><?=$bestrecommend['domain'];?>"><?=$bestrecommend['name'];?></a></h3>
			<div id="fresharea">
			<? if(is_array($fresh) && count($fresh)>0):?>     
            <?
               $today = $yestoday = $preday = false;
               $now = time();
               //今天时间 2011-7-28 0:0:0 < > 2011-7-29 0:0:0
               $nowtime = mktime(0,0,0,date('m'),date('d'),date('Y'));
               $yestime = mktime(0,0,0,date('m'),date('d')-1,date('Y')); 
               $todaytime = $now - 24*3600;
               $yestodaytime = $now - 2*24*3600;
			?> 
			<div class="onedayList">
			 <? foreach ($fresh as $fk => $row):?>
			 	
				<? 
				$endfk2 = 99;
				$endfk3 = 199;
				if(count($fresh) < $endfk2){
					$endfk2 = count($fresh);
					$endfk2 = $endfk2-1;
				} elseif (count($fresh) < $endfk3) {
					$endfk3 = count($fresh);
					$endfk3 = $endfk3-1;
				}
				?>
				
				<? if ($fk == 50):?>
					<div id="fk2" style="display:none;">
				<? elseif ($fk == 100):?>
					<div id="fk3" style="display:none;">
				<? endif;?>
			 	<!--新鲜事分今日、昨日、日期显示-->
			 			<? if(!$today && $row['addtime'] >= $nowtime):?>
						<p class="time" style="margin-top:18px;font-size:22px;padding-bottom:8px;border-bottom:1px dashed #999999">今日</p>
						<? $today = true;?>
						<? elseif (!$yestoday && $row['addtime'] >= $yestime && $row['addtime'] < $nowtime):?>
						<p class="time" style="margin-top:18px;font-size:22px;padding-bottom:8px;border-bottom:1px dashed #999999">昨日</p>
						<? $yestoday = true;?>
						<? elseif ($row['addtime'] < $yestime):?>
							<? $day = date('m月d日',$row['addtime']);?>
		                     	<? if($preday != $day):?>
		                     		<p class="time" style="margin-top:18px;font-size:22px;padding-bottom:8px;border-bottom:1px dashed #999999;"><?=$day;?></p>
		                     	<? endif;?>
		                        <? $preday = $day;?>
						<? endif;?>
						
						<!--新鲜事分3种类型显示方式-->
						<? if($row['typeid'] == 1):?>
							<div class="broadCast onedayListbbottom">
								<span class="listLeft" style="overflow:visible;<? if(isset($usersite["id"]) && $usersite["id"] == $row["siteid"]):?> border:2px solid #FBED1F;<? endif;?>"><img class="blank" src="<?=gurl('images');?>/tran.gif" /><a href="<?=$row['link'];?>" ><img src="<?=gurl('data');?>/upload_pic/<?=$row['sitelogo'];?>" onerror="this.src='<?=gurl('images');?>/testlogo1.gif';" width="60" height="60" alt="logo" /></a>
								</span>
								<span class="listRight">
									<a href="<?=$row['link'];?>" ><?=strip_tags($row['title']);?></a> <?php if($row['public'] == '1'):?><img src="/images/gong.gif" style="vertical-align:sub;" title="来自公共创建" /><? endif;?>
								</span>
								<p class="userName"><a  href="<?=c('site_url');?><?=$row['domain'];?>" class="cGreen" <? if(isset($usersite["id"]) && $usersite["id"] == $row["siteid"]):?> style="color:#E96234;" <? endif;?>><?=$row['sitename'];?></a></p>
							</div>
						<? elseif ($row['typeid'] == 2):?>
							<div class="onedayListdd onedayListbbottom">
								<a  href="<?=c('site_url');?><?=$row['domain'];?>"><?=$row['sitename'];?></a>添加了<?=$row['typestr'];?><a href="<?=$row['link'];?>" ><?=strip_tags($row['title']);?></a> <?php if($row['public'] == '1'):?><img src="/images/gong.gif" style="vertical-align:sub;" title="来自公共创建" /><? endif;?>
							</div>
						<? elseif ($row['typeid'] == 3):?>
							<div class="broadCast onedayListbbottom">
								<span class="listLeft" style="overflow:visible;"><img class="blank" src="<?=gurl('images');?>/tran.gif" /><a  href="/home/profile/<?=$row['userid'];?>"><img src="<?=gurl('data');?>/upload_pic/<?=$row['userphoto'];?>" onerror="this.src='<?=gurl('images');?>/testlogo1.gif';" width="60" height="60" alt="logo" /></a>
								</span>
								<span class="listRight">
									<span style="color:#444444;"><?=$row['username'];?></span>: <a  href="<?=$row['link'];?>" ><?=strip_tags($row['title']);?></a>
								</span>
								<p class="userName"><a  href="<?=c('site_url');?><?=$row['domain'];?>" class="cGreen"><?=$row['sitename'];?></a></p>
							</div>
						<? endif;?>
					<? if ($fk >=50 && ($fk == $endfk2 || $fk == $endfk3)):?>
					</div>
					<? endif;?>
					
			 <? endforeach;?>
			 </div>		
			<? else:?>
			<div style="width:500px; height:100px; background:url(images/nonews.gif);">
				<div style="margin-left:225px; padding-top:45px; font-size:22px;">没有新鲜事</div>
			</div>
			<? endif;?>
			</div>
			<div class="allmark">
				<div class="left"><a href="#TB_inline?height=120&width=396&inlineId=hiddenModalContent2&modal=true" class="cCGray f14px thickbox">全部标记为已读</a></div>
				<div class="left" style="margin-left:120px;" id="getmorefresh"><? if(is_array($fresh) && count($fresh) > 50):?><a href="javascript:morefresh();" class="cCGray f14px" style="color:#5A9ECE;">更多新鲜事</a><? endif;?></div>
				<div class="right"><a href="#fresh" class="goTop cCGray">返回顶部</a></div>
			</div>
			<? else:?>
			<ul class="webRenao">
				<li><a href="<? if(isset($bestrecommend['domain'])):?><?=c('site_url');?><?=$bestrecommend['domain'];?><? else:?><?=gurl('/');?><? endif;?>"><img src="<?=gurl('images');?>/day_renao.gif" alt="每日一站" /></a></li>
				<li><a href="<?=gurl('accounts');?>"><img src="<?=gurl('images');?>/reg_renao.gif" alt="登录注册" /></a></li>
				<li><a href="<?=gurl('found');?>"><img src="<?=gurl('images');?>/find_renao.gif" alt="发现轻站" /></a></li>
				<li><? if($account):?><a href="<?=gurl('accounts/opening');?>"><? else:?><a href="#TB_inline?height=120&width=396&inlineId=hiddenModalContentforopen&modal=true" class="cGray applyKey thickbox"><? endif;?><img src="<?=gurl('images');?>/apply_renao.gif" alt="申请轻站" /></a></li>
			</ul>
			<? endif;?>
			<div class="blank8"></div>
			<div class="renaoRec">
				<h2>精彩轻站</h2>
				<ul>
				<? foreach ($recommendsites as $site):?>
					<li><span class="listImg60"><img src="images/tran.gif" class="blank" /><a href="<?=c('site_url');?><?=$site['domain'];?>"><img src="<?=gurl('data');?>/upload_pic/<?=$site['info']['logo'];?>" onerror="this.src='<?=gurl('images');?>/testlogo1.gif';" alt="<?=$site['name'];?>" width="60" height="60" /></a></span><span class="listTxt"><a href="<?=c('site_url');?><?=$site['domain'];?>"><?=$site['name'];?></a><em class="cCGray">(<?=$site['funs'];?>)</em></span></li>
				<? endforeach;?>
				</ul>
				<div class="hackbox"></div>
			</div>
		</div>
	</div>
	<div class="sider">
			<h3 class="attention">关注我们</h3>
			<ul class="listAtt">
				<li><a href="http://www.renao100.com/site/renao100" >热闹百分百轻站</a></li>
				<li class="mysina"><a href="http://weibo.com/renao100" target="_blank">热闹网新浪微博</a></li>
				<li class="myqq"><a href="http://t.qq.com/renao100" target="_blank">热闹网腾讯微博</a></li>
			</ul>
			<div class="blank8"></div>
			<script language="javascript" src="http://www.renao100.com/ads/get/8"></script>
			<div class="blank8"></div>
			<h3 class="f14px">热闹严选</h3>
			<ul class="liststrict">
				<? foreach ($topics as $row):?>
				<li><a href="<?=c('site_url');?><?=$row['site']['domain'];?>/forum/show/<?=$row['id'];?>" title="<?=strip_tags($row['title']);?>" class="cGray"><?=msubstr(strip_tags($row["title"]),0,18);?></a></li>
				<? endforeach;?>
			</ul>
			<div class="blank8"></div>
			<script language="javascript" src="http://www.renao100.com/ads/get/11"></script>
			<div class="blank8"></div>
			<h3 class="f14px">看看轻站</h3>
			<ul class="listKK">
			<? foreach ($kansites as $site):?>
				<li><span class="listImg"><img src="images/tran.gif" class="blank" /><a href="<?=c('site_url');?><?=$site['domain'];?>"><img src="<?=gurl('data');?>/upload_pic/<?=$site['info']['logo'];?>" onerror="this.src='<?=gurl('images');?>/testlogo1.gif';" alt="<?=$site['name'];?>" width="60" height="60" /></a></span>
					<span class="listTxt"><a class="title" href="<?=c('site_url');?><?=$site['domain'];?>"><?=$site['name'];?></a>
						<em class="intr"><?=$site['info']['description'];?></em>
						<em class="cCGray"><?=$site['funs'];?>人关注</em>
					</span>
				</li>
			<? endforeach;?>	
			</ul>
			<div class="hackbox"></div>
			<script language="javascript" src="http://www.renao100.com/ads/get/12"></script>
			<script language="javascript" src="http://www.renao100.com/ads/get/13"></script>
			<script language="javascript" src="http://www.renao100.com/ads/get/14"></script>
		</div>
	<div class="hackbox"></div>
</div>
<script language="javascript">
	$(document).ready(function(){		
		aj_get_banner(39, "indexbanner");
	})
</script>
